<template>
  <div id="StatisticalTable">
    <!-- 按楼盘汇总账单 -->
    <el-table :data="mydata" style="width: 100%" :title="title">
      <el-table-column prop="real_estate_name" label="楼盘名称" align="center">
      </el-table-column>
      <el-table-column prop="goods_type" label="商品类型" align="center">
      </el-table-column>
      <!-- <el-table-column prop="startdate" label="开盘时间" align="center">
      </el-table-column>
      <el-table-column prop="enddate" label="结束时间" align="center">
      </el-table-column> -->
      <el-table-column prop="total" label="订单总额" align="center">
      </el-table-column>
      <el-table-column prop="disponse_total" label="退款总额" align="center">
      </el-table-column>
      <el-table-column prop="" label="操作" align="center">
        <template slot-scope="scope">
          <i class="el-icon-edit see" @click="select(scope.row)">查看</i>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <el-pagination
      background
      layout="prev, pager, next"
      :total="tableData.length"
      :current-page="nowpage"
      :page-size="1"
      @current-change="changePage"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "StatisticalTable",
  props: ["mydata", "title", "nowpage", "tableData"],
  data() {
    return {};
  },
  methods: {
    select(row) {
      // console.log(row.real_estate_id);
      // console.log(row.goods_type);
      if (row.goods_type == "团购优惠") {
        this.$emit("show", row);
      } else {
        console.log(row);
        this.$emit("show1", row);
      }
    },
    /* 修改当前页 */
    changePage(val) {
      // console.log(val);
      this.$emit("change", val);
    },
  },
  created() {},
};
</script>

<style>
.see {
  color: blue;
  cursor: pointer;
}
.el-pagination {
  text-align: center;
}
</style>